//
//  EntryPointsHandler.m
//  mUBB
//
//  Created by Cosmin Stirbu on 1/15/13.
//  Copyright (c) 2013 Cosmin Stirbu. All rights reserved.
//

#import "EntryPointsHandler.h"
#import "UserDefaultsManager.h"
#import "EntryPointsProtocol.h"

@implementation EntryPointsHandler

- (void)handleSuccess:(WSResponse *)response {
    NSDictionary *entryPointsDictionary = [response.data objectFromJSONData];
    for (NSString *serviceURLKey in [entryPointsDictionary allKeys]) {
        [UserDefaultsManager saveObject:[entryPointsDictionary objectForKey:serviceURLKey] forKey:serviceURLKey];
    }
    [self.delegate didReceiveEntryPointsWithSuccess:nil forTicket:self.ticket];
}

- (void)handleError:(WSError *)error {
    [self.delegate didReceiveEntryPointsWithError:error forTicket:self.ticket];
}

@end
